Two-dimensional proof-relevant parametricity
نویسندگان
چکیده
Relational parametricity is a fundamental concept within theoretical computer science and the foundations of programming languages, introduced by John Reynolds [6]. His fundamental insight was that types can be interpreted not just as functors on the category of sets, but also as equality preserving functors on the category of relations. This gives rise to a model where polymorphic functions are uniform in a suitable sense; this can be used to establish e.g. representation independence, equivalences between programs, or deriving useful theorems about programs from their type alone [7]. The relations Reynolds considered were proof-irrelevant, which from a type theoretic perspective is a little limited. As a result, one might like to extend his work to deal with proof-relevant, i.e. set-valued relations. However naive attempts to do this fail: the fundamental property of equality preservation cannot be established. Our insight is that just as one uses parametricity to restrict definable elements of a type, one can use parametricity to restrict definable proofs to ensure equality preservation in the proof-relevant setting. Proof-relevant logical relations also appear in Benton, Hofmann and Nigam’s recent work [1], but for unary relations, and in a setting without ∀-types. Hence they do not need to consider equality preservation. In our work, we consider proof-relevant binary relations. A proof-relevant relation R over two sets A and B consists of a map R : A × B → Set which, for every two elements (a, b) ∈ A×B, associates a set of proofs that they are related. On top of this, we have a new proof-irrelevant layer: a 2-dimensional relation Q is defined over four sets and four binary proof-relevant relations. It can be thought of as over a square, where the vertices are sets and the edges are the binary proof-relevant relations:
منابع مشابه
Subtyping and Parametricity
In this paper we study the interaction of subtyping and parametricity. We describe a logic for a programming language with parametric polymorphism and subtyping. The logic supports the formal definition and use of relational parametricity. We give two models for it, and compare it with other formal systems for the same language. In particular, we examine the “Penn interpretation” of subtyping a...
متن کاملOn Monadic Parametricity of Second-Order Functionals
How can one rigorously specify that a given ML functional f : (int → int) → int is pure, i.e., f produces no computational effects except those produced by evaluation of its functional argument? In this paper, we introduce a semantic notion of monadic parametricity for second-order functionals which is a form of purity. We show that every monadically parametric f admits a question-answer strate...
متن کاملOutline of a proof theory of parametricityHarry
Reynolds' Parametricity Theorem (also known as the Abstraction Theorem), a result concerning the model theory of the second order polymorphic typed-calculus (F 2), has recently been used by Wadler to prove some unusual and interesting properties of programs. We present a purely syntactic version of the Parametricity Theorem, showing that it is simply an example of formal theorem proving in seco...
متن کاملSyntax for Free: Representing Syntax with Binding Using Parametricity
We show that, in a parametric model of polymorphism, the type ∀α.((α → α) → α) → (α → α → α) → α is isomorphic to closed de Bruijn terms. That is, the type of closed higher-order abstract syntax terms is isomorphic to a concrete representation. To demonstrate the proof we have constructed a model of parametric polymorphism inside the Coq proof assistant. The proof of the theorem requires parame...
متن کاملParametricity in an Impredicative Sort
Reynold’s abstraction theorem is now a well-established result for a large class of type systems. We propose here a definition of relational parametricity and a proof of the abstraction theorem in the Calculus of Inductive Constructions (CIC), the underlying formal language of Coq, in which parametricity relations’ codomain is the impredicative sort of propositions. To proceed, we need to refin...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2015